const { get, post } = require('../utils/request')

/**
 * 消费记录相关API接口
 */

// 获取当前用户的消费记录列表
const getMyConsumptionRecords = () => {
  return get('/consumption-record/my')
}

// 分页查询当前用户的消费记录
const getMyConsumptionRecordPage = (params) => {
  return get('/consumption-record/my/page', params)
}

// 根据ID查询消费记录详情
const getConsumptionRecordById = (id) => {
  return get(`/consumption-record/${id}`)
}

// 根据订单号查询消费记录
const getConsumptionRecordByOrderNo = (orderNo) => {
  return get(`/consumption-record/order/${orderNo}`)
}

// 获取当前用户消费统计信息
const getMyConsumptionStatistics = () => {
  return get('/consumption-record/my/statistics')
}

module.exports = {
  getMyConsumptionRecords,
  getMyConsumptionRecordPage,
  getConsumptionRecordById,
  getConsumptionRecordByOrderNo,
  getMyConsumptionStatistics
}
